#pragma once
#include <drogon/HttpController.h>
using namespace drogon;
class Search:public drogon::HttpController<Search>
{
  public:
    METHOD_LIST_BEGIN
      METHOD_ADD(Search::getIndex,"", Get);
      METHOD_ADD(Search::getToc,"/toc", Get);
      METHOD_ADD(Search::getPage,"/page", Get);
      METHOD_ADD(Search::addPage,"/addpage", Get);
    METHOD_LIST_END
    void getIndex(const HttpRequestPtr& req,std::function<void (const HttpResponsePtr &)> &&callback);
    void getToc(const HttpRequestPtr& req,std::function<void (const HttpResponsePtr &)> &&callback);
    void getPage(const HttpRequestPtr& req,std::function<void (const HttpResponsePtr &)> &&callback);
    void addPage(const HttpRequestPtr& req,std::function<void (const HttpResponsePtr &)> &&callback);
};
